// to - function命令可以一键将箭头函数转换为函数声明;

/**

 * @param a
 * @param n
 * @returns {string}
 *  箭头函数转换为函数声明
 */
function aaa(a: string, n: number): string {
  return a + n;
}

export const addHandle = async () => {
  return new Promise((resolve, reject) => {
    resolve(10);
    reject(new Error("20"));
  });
};

const res = (a: string, b: string) => {
  console.log("11111");
  return a + b;
};

const ccc = async () => {
  return new Promise((resolve, reject) => {
    resolve(10);
    reject(new Error("20"));
  });
};

// / to-promise-all 可以 一键将异步函数更改成promise.all;
// 更改前的代码
const g = await addHandle();
const j = await ccc();
// 更改后的代码
const [g, j] = await Promise.all([bbb(), ccc()] as const);
